package com.yzy.fly.type;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

public enum FileType {
    PNG("png", ".png"),
    JPG("jpg", ".jpg"),
    JAVA("java", ".java"),
    CLASS("class",".class"),
    HBM("hbm", ".hbm.xml"),
    XML("xml", ".xml"),
    JSON("json", ".json"),
    XLS("xls","xls"),//Excel 2003
    XLSX("xlsx",".xlsx"); // Excel 2007
    ;

    @Setter
    @Getter
    private String type;
    @Setter
    @Getter
    private String value;

    FileType(String type, String value) {
        this.type = type;
        this.value = value;
    }

//    public static FileType type(String type) {
//        if (StringUtils.isBlank(type)) {
//            return null;
//        }
//        FileType asmFieldType;
//        try {
//            asmFieldType = FileType.valueOf(type);
//        } catch (IllegalArgumentException e) {
//            e.printStackTrace();
//            asmFieldType = null;
//        }
//        return asmFieldType;
//    }


}
